window.onload = function () {
  const searchBtn = document.querySelector('#searchBtn')
  const searchInput = document.querySelector('#searchInput')
  searchBtn.onclick = function () {
    // 1.将active类设置开关
    searchBtn.classList.toggle('active')
    searchInput.classList.toggle('active')
    // 2.设置焦点
    searchInput.focus()
  }
}
